{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e7f45edb-f5b9-469f-a52b-f8f847c6fa80",
   "metadata": {},
   "source": [
    "Chapter 04\n",
    "\n",
    "# 逻辑函数\n",
    "Book_7《机器学习》 | 鸢尾花书：从加减乘除到机器学习"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "8a8f9e18-f949-415a-9d8b-31b5ad7bf519",
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "from scipy.special import expit\n",
    "\n",
    "x = np.linspace(-5, 5, 100)\n",
    "\n",
    "f_x = expit(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "cfb340cd-b76a-4d36-b810-5ef72ccf95bc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcwAAAEmCAYAAADvBKBiAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAs4ElEQVR4nO3de1xVVf7/8RcXATUgryheSa00Jv0KZmqUl8Rbpk4lTpN2UScm05SxRsZG06b4TU1lZailZqWpo5k2M0xJj0rJyySEXfCWpUICGtgA3kDg/P5YA0SgHRDYG877+XisxzlnsQ98OA/p3dp7r7XcHA6HAxEREbkkd6sLEBERqQ8UmCIiIk5QYIqIiDhBgSkiIuIEBaaIiIgTFJgiIiJOUGCKiIg4QYEpIiLiBE+rC7BKcXEx6enp+Pr64ubmZnU5IiJiEYfDQV5eHoGBgbi7X3wc6bKBmZ6eTocOHawuQ0REbCItLY327dtf9OsuG5i+vr6A+YD8/PwsrkZERKySm5tLhw4dSnPhYlw2MEtOw/r5+SkwRUTkFy/P6aYfERERJygwRUREnGCLwNy+fTujR48mMDAQNzc3Nm/e/Ivv2bZtGyEhIfj4+HDVVVexdOnS2i9URER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UyERERZGdns3DhQjIyMggODiYuLo5OnTpZXZotLVmyBICBAweW63/99de577776r4gqXM6JSsiIuIE3QUhIiLiBAWmiIiIExSYIiIiTlBgioiIOEGBKSIi4gQFpoiIiBMUmCIiIk5QYIqIiDhBgSkiIuIEBaaIiIgTFJgiLmjt2rX4+Phw/Pjx0r4pU6Zw/fXXk5OTY2FlIvaltWRFXJDD4aBXr16EhYWxePFiFixYwPLly9m9ezft2rWzujwRW9JuJSIuyM3Njaeeeoo777yTwMBAXnzxRRISEhSWIpegEaaIC+vduzcpKSls3bqVW265xepyRGxN1zBFXNQHH3zAgQMHKCoqIiAgwOpyRGxPI0wRF/T5558zcOBAXnnlFdatW0eTJk3YsGGD1WWJ2JquYYq4mKNHjzJq1CjmzJnDxIkT6dGjB3369CEpKYmQkBCryxOxLY0wRVzIqVOnGDBgADfffDPLli0r7R8zZgz5+fm8//77FlYnYm8KTBERESfoph8REREnKDBFREScoMAUERFxggJTRETECQpMERERJygwRUREnKDAFBERcYICU0RExAkKTBEREScoMEVERJygwBQREXGCAlNERMQJ/x/ceG/RYNjQQAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 500x300 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plot the logistic function\n",
    "\n",
    "fig, ax = plt.subplots(1, 1, figsize=(5, 3))\n",
    "ax.plot(x, f_x, 'b-')\n",
    "ax.set_xlabel('$x$')\n",
    "ax.set_ylabel('$f(x)$')\n",
    "ax.set_xlim(-5, 5)\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
